// NationscapePubOp
log using NationscapePubOp.log, replace
use "C:\Users\sbstjp\OneDrive - Cardiff University\Nationscapedataset.dta" // Tausanovitch, Chris and Lynn Vavreck. 2020. Democracy Fund + UCLA Nationscape, October 10-17, 2019 (version 20200814). Retrieved from [URL].  Date accessed: March 09, 2025.

keep statements_gender_identity reparations group_favorability_blm group_favorability_undocumented weight ideo5 start_date gender age education race_ethnicity

// Demographic variables

*Drop missing values
replace ideo5=. if ideo5==999

*Reverse code gender 
egen maxval = max(gender)
gen FemaleGender = maxval + 1 - gender
drop maxval

*Create dummies
gen Graduate=.
replace Graduate=0 if inrange(education, 1, 7)
replace Graduate=1 if inrange(education, 8, 11)

gen BIPOC=. 
replace BIPOC=0 if race_ethnicity==1
replace BIPOC=1 if inrange(race_ethnicity, 2, 15)

//Delete missing values
replace reparations=. if reparations==888 
replace statements_gender_identity=. if statements_gender_identity==888 

//The questions
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5<3 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5>3 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==0 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==1 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==0 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==1 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==1 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==2 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age<35 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>=35 & age<=59 [aweight=weight]
tab statements_gender_identity if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>59 [aweight=weight]

tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5<3 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5>3 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==0 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==1 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==0 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==1 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==1 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==2 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age<35 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>=35 & age<=59 [aweight=weight]
tab group_favorability_blm if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>59 [aweight=weight]

tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5<3 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5>3 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==0 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==1 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==0 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==1 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==1 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==2 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age<35 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>=35 & age<=59 [aweight=weight]
tab reparations if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>59 [aweight=weight]

tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5<3 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & ideo5>3 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==0 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & Graduate==1 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==0 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & BIPOC==1 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==1 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & FemaleGender==2 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age<35 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>=35 & age<=59 [aweight=weight]
tab group_favorability_undocumented if month(dofc(start_date)) >= 10 & month(dofc(start_date)) <= 12 & year(dofc(start_date)) == 2020 & age>59 [aweight=weight]


log close

 